home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
eulisp
/
feel0_89.lha
/
Feel
/
Modules
/
while.em
< prev
next >
Wrap
Lisp/Scheme
|
1993-07-13
|
695b
|
29 lines
(defmodule while
(eulisp0) ()
(defun map-while (ff pf)
(if (pf) (progn (ff) (map-while ff pf)) nil))
(defmacro while (pred . forms)
`(map-while (lambda () (progn ,@forms)) (lambda () ,pred)))
(defmacro ++ (form . vals)
(cond ((atom form)
`(setq ,form (+ ,form 1)))
((eq (car form) 'dynamic)
`(dynamic-setq ,(cadr form) (+ ,form 1)))
(t
`((setter ,(car form)) ,(cadr form) (+ ,form 1)))))
(defmacro -- (form)
(cond ((atom form)
`(setq ,form (- ,form 1)))
((eq (car form) 'dynamic)
`(dynamic-setq ,(cadr form) (- ,form 1)))
(t
`((setter ,(car form)) ,(cadr form) (- ,form 1)))))
(export map-while while ++ --)
)